<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../vue.js"></script>
</head>

<body>
  <div id="app">
    {{message}}-
    {{user.name}}

  </div>
  <script>
    var user = {
      name: "xiaoming",
      age: 20
    }
    Object.freeze(user);
    var vm = new Vue({
      el: '#app',
      data: {
        message: "helloworld",
        // username:"admin"
        username: '',
        user
      }
    })

    vm.$watch('message', function (newval, oldval) {
      console.log(newval, oldval)
    })

  </script>
</body>

</html>